@extends('admin.layout.layout')
@section('content')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span><i class="icon-table"></i> 用户列表</span>
        </div>
        <div class="mws-panel-body no-padding">
         <form method="get" action="{{url('admin/user/index')}}">
            <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper"><div id="DataTables_Table_1_length" class="dataTables_length"><label>每页显示条数 <select name="pagenum" size="1" aria-controls="DataTables_Table_1"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option></select> 条</label></div>
           
            <div class="dataTables_filter" id="DataTables_Table_1_filter"><label>搜索:<input type="text" name='keyword' value="" aria-controls="DataTables_Table_1">
           
                    <input type="submit" class="btn btn-danger" value="搜索">
                  
               
            </label>
             </div>
            </form>
            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                    <thead>
                    <tr role="row"><th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:156px;
    " aria-sort="ascending" aria-label="Rendering engine:activate to sort column descending">用户id</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:212px;
    " aria-label="Browser:activate to sort column ascending">用户名</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:197px;
    " aria-label="Platform(s):activate to sort column ascending">头像</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:133px;
    " aria-label="Engine version:activate to sort column ascending">添加时间</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">权限</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">电话</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">邮箱</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">操作</th></tr>
                    </thead>

                    <tbody role="alert" aria-live="polite" aria-relevant="all">
                    @foreach($data as $v)
                    <tr class="odd">
                        <td >{{$v['adm_id']}}</td>
                        <td >{{$v['adm_name']}}</td>
                        <td ><img style="width:100px;heigth:100px" src="/{{$v['adm_face']}}"/> </td>
                        <td >{{date('Y-m-d H:i:s',time())}}</td>
                        <td >{{$v['adm_role_id']}}</td>
                        <td >{{$v['adm_tel']}}</td>
                        <td >{{$v['adm_email']}}</td>
                        <td >
                            <a href="/admin/user/edit/{{$v['adm_id']}}"><i style="color:black;font-size: 20px;" title="修改" class="icon-pencil-2"></i></a>&nbsp;&nbsp;&nbsp;
                            {{--<a  href="/admin/user/delete/{{$v['adm_id']}}"><i style="color:black;font-size: 20px;" title="删除" class="icon-trash"></i></a>--}}
                            <a  id="" href="javascript:;" ><i onclick="del({{$v['adm_id']}})" style="color:black;font-size: 20px;" title="删除" class="icon-trash"></i></a>
                        </td>

                    </tr>
                    @endforeach
                    </tbody>
            </table>
            <div id="page_page">
                {!! $data->appends('request')->render() !!}
            </div>
    </div>
        <script src="/admin/js/libs/jquery-1.8.3.min.js"></script>
        <script>

               function del(adm_id){
                   $.get('/admin/user/delete/'+adm_id,function(data){
                       if(data['status']==0){
                           location.href = location.href;
                       }else{

                       }
                   })
               }

    </script>
    @endsection
